<?php

class JElementCategories extends JElement
{
	/**
	 * Element name
	 *
	 * @access	protected
	 * @var		string
	 */
	var $_name = 'Categories';

	function __construct( $parent = null )
	{
		parent::__construct( $parent );
		JFactory::getDocument()->addScript( JURI::root( true ). '/administrator/components/com_jloja/elements/categories/categories.js' );
		JFactory::getDocument()->addStyleSheet( JURI::root( true ). '/administrator/components/com_jloja/elements/categories/cats.css' );
	}
	function fetchElement($name, $value, &$node, $control_name)
	{
		$catModel = new Category();
		$categories = $catModel->getPublishedCategories();
		include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR .  'categories' . DIRECTORY_SEPARATOR . 'tmpl.php';
	}

	function fetchTooltip($label, $description, &$xmlElement, $control_name='', $name='')
	{
		return;
	}

}
